package com.xc.generics;

import org.apache.commons.lang3.ObjectUtils;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        ArrayList<Integer> integerList = new ArrayList<>();
        integerList.add(1);
        integerList.add(2);
        printIntVal(integerList);

        ArrayList<Float> floatList = new ArrayList<>();
        floatList.add((float) 1.0);
        floatList.add((float) 2.0);
        printIntVal(floatList);
    }

    public static void printIntVal(List list) {
        for (Object object : list) {
            System.out.print(Integer.valueOf(object.toString()) + " ");
        }
        System.out.println();
    }
}